home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / thinkref / archive / THINKPascalUH2.1.sea / THINKPas Univ Hdr 2.1 / Interfaces / OCEMessaging.p < prev    next >
Text File  |  1995-09-14  |  28KB  |  1,144 lines

  1. { Converted with MPW2TPas Tuesday, September 12, 1995 8:33:10 PM }
  2. {}
  3. {     File:        OCEMessaging.p}
  4. { }
  5. {     Contains:    Apple Open Collaboration Environment Messaging Interfaces.}
  6. { }
  7. {     Version:    Technology:    AOCE Toolbox 1.02}
  8. {                 Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18}
  9. { }
  10. {     Copyright:    © 1984-1995 by Apple Computer, Inc.}
  11. {                 All rights reserved.}
  12. { }
  13. {     Bugs?:        If you find a problem with this file, use the Apple Bug Reporter}
  14. {                 stack.  Include the file and version information (from above)}
  15. {                 in the problem description and send to:}
  16. {                     Internet:    apple.bugs@applelink.apple.com}
  17. {                     AppleLink:    APPLE.BUGS}
  18. { }
  19. {}
  20.  
  21. unit OCEMessaging;
  22. interface
  23.  
  24.  
  25. {$IFC UNDEFINED __OCEMESSAGING__}
  26. {$SETC __OCEMESSAGING__ := 1}
  27.  
  28.     uses
  29.         ConditionalMacros, Types, AppleTalk, Processes, PPCToolbox, Notification, EPPC, Files, Aliases, AppleEvents, DigitalSignature, OCE, OCEAuthDir;
  30.  
  31. { $PUSH}
  32. { $ALIGN MAC68K}
  33. { $LibExport+}
  34. {****************************************************************************}
  35. { Definitions common to OCEMessaging and to OCEMail. These relate to addressing,}
  36. {message ids and priorities, etc. }
  37. { Values of IPMPriority }
  38.  
  39.     const
  40.         kIPMAnyPriority = 0;                            { FOR FILTER ONLY }
  41.         kIPMNormalPriority = 1;
  42.         kIPMLowPriority = 2;
  43.         kIPMHighPriority = 3;
  44.  
  45.  
  46.     type
  47.         IPMPriority = SignedByte;
  48.  
  49. { Values of IPMAccessMode }
  50.  
  51.     const
  52.         kIPMAtMark = 0;
  53.         kIPMFromStart = 1;
  54.         kIPMFromLEOM = 2;
  55.         kIPMFromMark = 3;
  56.  
  57.  
  58.     type
  59.         IPMAccessMode = INTEGER;
  60.  
  61.  
  62.     const
  63.         kIPMUpdateMsgBit = 4;
  64.         kIPMNewMsgBit = 5;
  65.         kIPMDeleteMsgBit = 6;
  66.  
  67. { Values of IPMNotificationType }
  68.         kIPMUpdateMsgMask = $10;
  69.         kIPMNewMsgMask = $20;
  70.         kIPMDeleteMsgMask = $40;
  71.  
  72.  
  73.     type
  74.         IPMNotificationType = SignedByte;
  75.  
  76. { Values of IPMSenderTag }
  77.  
  78.     const
  79.         kIPMSenderRStringTag = 0;
  80.         kIPMSenderRecordIDTag = 1;
  81.  
  82.  
  83.     type
  84.         IPMSenderTag = INTEGER;
  85.  
  86.  
  87.     const
  88.         kIPMFromDistListBit = 0;
  89.         kIPMDummyRecBit = 1;
  90.         kIPMFeedbackRecBit = 2;                            { should be redirected to feedback queue }
  91.         kIPMReporterRecBit = 3;                            { should be redirected to reporter original queue }
  92.         kIPMBCCRecBit = 4;                            { this recipient is blind to all recipients of message }
  93.  
  94. { Values of OCERecipientOffsetFlags }
  95.         kIPMFromDistListMask = $1;
  96.         kIPMDummyRecMask = $2;
  97.         kIPMFeedbackRecMask = $4;
  98.         kIPMReporterRecMask = $8;
  99.         kIPMBCCRecMask = $10;
  100.  
  101.  
  102.     type
  103.         OCERecipientOffsetFlags = SignedByte;
  104.  
  105.         OCECreatorType = record
  106.                 msgCreator: OSType;
  107.                 msgType: OSType;
  108.             end;
  109.  
  110.  
  111.     const
  112.         kIPMTypeWildCard = 'ipmw';
  113.         kIPMFamilyUnspecified = 0;
  114.         kIPMFamilyWildCard = $3F3F3F3F;                    { '??^ }
  115. {}
  116. {    * well known signature }
  117.         kIPMSignature = 'ipms';                        { base type }
  118. {}
  119. {    * well known message types }
  120.         kIPMReportNotify = 'rptn';                        { routing feedback}
  121. {}
  122. {    * well known message block types }
  123.         kIPMEnclosedMsgType = 'emsg';                        { enclosed (nested) message }
  124.         kIPMReportInfo = 'rpti';                        { recipient information }
  125.         kIPMDigitalSignature = 'dsig';
  126.  
  127. { Values of IPMMsgFormat }
  128.         kIPMOSFormatType = 1;
  129.         kIPMStringFormatType = 2;
  130.  
  131.  
  132.     type
  133.         IPMMsgFormat = INTEGER;
  134.  
  135.         IPMStringMsgType = Str32;
  136.  
  137.         TheType = record
  138.                 case INTEGER of
  139.                     0: (
  140.                             msgOSType: OCECreatorType;
  141.                     );
  142.                     1: (
  143.                             msgStrType: IPMStringMsgType;
  144.                     );
  145.             end;
  146.  
  147.         IPMMsgType = record
  148.                 format: IPMMsgFormat;                            { IPMMsgFormat}
  149.                 theType: TheType;
  150.             end;
  151.  
  152. {}
  153. {Following are the known extension values for IPM addresses handled by Apple.}
  154. {We define the definition of the entn extension below.}
  155. {}
  156.  
  157.     const
  158.         kOCEalanXtn = 'alan';
  159.         kOCEentnXtn = 'entn';                        { entn = entity name (aka DSSpec) }
  160.         kOCEaphnXtn = 'aphn';
  161.  
  162. {}
  163. {Following are the specific definitions for the extension for the standard}
  164. {OCEMail 'entn' addresses.  [Note, the actual extension is formatted as in}
  165. {IPMEntityNameExtension.]}
  166. {}
  167. { entn extension forms }
  168.         kOCEAddrXtn = 'addr';
  169.         kOCEQnamXtn = 'qnam';
  170.         kOCEAttrXtn = 'attr';                        { an attribute specification }
  171.         kOCESpAtXtn = 'spat';
  172.  
  173. {}
  174. {Following are the specific definitions for standard}
  175. {OCEMail 'aphn' extension value.  }
  176. {}
  177. {All RStrings here are packed (e.g. truncated to length) and even padded (e.g.}
  178. {if length odd, then a pad byte (zero) should be introduced before the next field).}
  179. {}
  180. {The extension value is in the packed form of the following structure:}
  181. {    RString        phoneNumber;}
  182. {    RString        modemType;}
  183. {    Str32        queueuName;}
  184. {}
  185. {The body of phoneNumber compound RString is in the packed form of the following structure:}
  186. {    short         subType;}
  187. {    RString     countryCode;                // used when subType == kOCEUseHandyDial}
  188. {    RString        areaCode;                    // used when subType == kOCEUseHandyDial}
  189. {    RString        phone;                        // used when subType == kOCEUseHandyDial}
  190. {    RString        postFix;                    // used when subType == kOCEUseHandyDial}
  191. {    RString        nonHandyDialString;            // used when subType == kOCEDontUseHandyDial}
  192. {}
  193. { phoneNumber sub type constants }
  194.         kOCEUseHandyDial = 1;
  195.         kOCEDontUseHandyDial = 2;
  196.  
  197. { FORMAT OF A PACKED FORM RECIPIENT }
  198.  
  199.     type
  200.         ProtoOCEPackedRecipient = record
  201.                 dataLength: INTEGER;
  202.             end;
  203.  
  204.  
  205.     const
  206.         kOCEPackedRecipientMaxBytes = 4094;
  207.  
  208.  
  209.     type
  210.         OCEPackedRecipient = record
  211.                 dataLength: INTEGER;
  212.                 data: array[0..4093] of SInt8; { Byte }
  213.             end;
  214.  
  215.         IPMEntnQueueExtension = record
  216.                 queueName: Str32;
  217.             end;
  218.  
  219. { kOCEAttrXtn }
  220.         IPMEntnAttributeExtension = record
  221.                 attributeName: AttributeType;
  222.             end;
  223.  
  224. { kOCESpAtXtn }
  225.         IPMEntnSpecificAttributeExtension = record
  226.                 attributeCreationID: AttributeCreationID;
  227.                 attributeName: AttributeType;
  228.             end;
  229.  
  230. { All IPM entn extensions fit within the following }
  231.         IPMEntityNameExtension = record
  232.                 subExtensionType: OSType;
  233.                 case INTEGER of
  234.                     0: (
  235.                             specificAttribute: IPMEntnSpecificAttributeExtension;
  236.                     );
  237.                     1: (
  238.                             attribute: IPMEntnAttributeExtension;
  239.                     );
  240.                     2: (
  241.                             queue: IPMEntnQueueExtension;
  242.                     );
  243.  
  244.             end;
  245.  
  246. { addresses with kIPMNBPXtn should specify this nbp type }
  247.         IPMMsgID = record
  248.                 id: array[0..3] of LONGINT;
  249.             end;
  250.  
  251. { Values of IPMHeaderSelector }
  252.  
  253.     const
  254.         kIPMTOC = 0;
  255.         kIPMSender = 1;
  256.         kIPMProcessHint = 2;
  257.         kIPMMessageTitle = 3;
  258.         kIPMMessageType = 4;
  259.         kIPMFixedInfo = 7;
  260.  
  261.  
  262.     type
  263.         IPMHeaderSelector = SInt8;
  264.  
  265.         TheSender = record
  266.                 case INTEGER of
  267.                     0: (
  268.                             rString: RString;
  269.                     );
  270.                     1: (
  271.                             rid: PackedRecordID;
  272.                     );
  273.             end;
  274.  
  275.         IPMSender = record
  276.                 sendTag: IPMSenderTag;
  277.                 theSender: TheSender;
  278.             end;
  279.  
  280. {****************************************************************************}
  281. { Definitions specific to OCEMessaging }
  282.         IPMContextRef = LONGINT;
  283.  
  284.         IPMQueueRef = LONGINT;
  285.  
  286.         IPMMsgRef = LONGINT;
  287.  
  288.         IPMSeqNum = LONGINT;
  289.  
  290.         IPMProcHint = Str32;
  291.  
  292.         IPMQueueName = Str32;
  293.  
  294.         IPMNoteProcPtr = ProcPtr;  { PROCEDURE IPMNote(queue: IPMQueueRef; seqNum: IPMSeqNum; notificationType: ByteParameter; userData: LONGINT); }
  295.         IPMNoteUPP = UniversalProcPtr;
  296.  
  297.     const
  298.         uppIPMNoteProcInfo = $000037C0; { PROCEDURE (4 byte param, 4 byte param, 1 byte param, 4 byte param); }
  299.  
  300.     function NewIPMNoteProc (userRoutine: IPMNoteProcPtr): IPMNoteUPP;
  301.     {$IFC NOT GENERATINGCFM }
  302.     inline
  303.         $2E9F;
  304.     {$ENDC}
  305.  
  306.     procedure CallIPMNoteProc (queue: IPMQueueRef; seqNum: IPMSeqNum; notificationType: ByteParameter; userData: LONGINT; userRoutine: IPMNoteUPP);
  307.     {$IFC NOT GENERATINGCFM}
  308.     inline
  309.         $205F, $4E90;
  310.     {$ENDC}
  311.  
  312.     type
  313.         IPMFixedHdrInfo = record
  314.                 version: INTEGER;
  315.                 authenticated: BOOLEAN;
  316.                 signatureEnclosed: BOOLEAN;                                {  digital signature enclosed }
  317.                 msgSize: LONGINT;
  318.                 notification: IPMNotificationType;
  319.                 priority: IPMPriority;
  320.                 blockCount: INTEGER;
  321.                 originalRcptCount: INTEGER;                                {        original number of recipients }
  322.                 refCon: LONGINT;                                {        Client defined data }
  323.                 reserved: INTEGER;
  324.                 creationTime: UTCTime;                                {        Time when it was created }
  325.                 msgID: IPMMsgID;
  326.                 family: OSType;                                    { family this msg belongs (e.g. mail) }
  327.             end;
  328.  
  329.  
  330.     const
  331.         kIPMDeliveryNotificationBit = 0;
  332.         kIPMNonDeliveryNotificationBit = 1;
  333.         kIPMEncloseOriginalBit = 2;
  334.         kIPMSummaryReportBit = 3;
  335. { modify enclose original to only on error }
  336.         kIPMOriginalOnlyOnErrorBit = 4;
  337.  
  338.         kIPMNoNotificationMask = $00;
  339.         kIPMDeliveryNotificationMask = $1;
  340.         kIPMNonDeliveryNotificationMask = $2;
  341.         kIPMDontEncloseOriginalMask = $00;
  342.         kIPMEncloseOriginalMask = $4;
  343.         kIPMImmediateReportMask = $00;
  344.         kIPMSummaryReportMask = $8;
  345.         kIPMOriginalOnlyOnErrorMask = $10;
  346.         kIPMEncloseOriginalOnErrorMask = $14;
  347.  
  348. { standard Non delivery codes }
  349.         kIPMNoSuchRecipient = $0001;
  350.         kIPMRecipientMalformed = $0002;
  351.         kIPMRecipientAmbiguous = $0003;
  352.         kIPMRecipientAccessDenied = $0004;
  353.         kIPMGroupExpansionProblem = $0005;
  354.         kIPMMsgUnreadable = $0006;
  355.         kIPMMsgExpired = $0007;
  356.         kIPMMsgNoTranslatableContent = $0008;
  357.         kIPMRecipientReqStdCont = $0009;
  358.         kIPMRecipientReqSnapShot = $000A;
  359.         kIPMNoTransferDiskFull = $000B;
  360.         kIPMNoTransferMsgRejectedbyDest = $000C;
  361.         kIPMNoTransferMsgTooLarge = $000D;
  362.  
  363. {***********************************************************************}
  364. {}
  365. {This is the structure that will be returned by enumerate and getmsginfo}
  366. {This definition is just to give you a template, the position of msgType}
  367. {is variable since this is a packed structure.  procHint and msgType are}
  368. {packed and even length padded.}
  369. {}
  370. {* master message info }
  371.  
  372.     type
  373.         IPMMsgInfo = record
  374.                 sequenceNum: IPMSeqNum;
  375.                 userData: LONGINT;
  376.                 respIndex: INTEGER;
  377.                 padByte: SInt8;
  378.                 priority: IPMPriority;
  379.                 msgSize: LONGINT;
  380.                 originalRcptCount: INTEGER;
  381.                 reserved: INTEGER;
  382.                 creationTime: UTCTime;
  383.                 msgID: IPMMsgID;
  384.                 family: OSType;                                    { family this msg belongs (e.g. mail) }
  385.                 procHint: IPMProcHint;
  386.                 filler2: SInt8;
  387.                 msgType: IPMMsgType;
  388.             end;
  389.  
  390.         IPMBlockType = OCECreatorType;
  391.  
  392.         IPMTOC = record
  393.                 blockType: IPMBlockType;
  394.                 blockOffset: LONGINT;
  395.                 blockSize: LONGINT;
  396.                 blockRefCon: LONGINT;
  397.             end;
  398.  
  399. {}
  400. {The following structure is just to describe the layout of the SingleFilter.}
  401. {Each field should be packed and word aligned when passed to the IPM ToolBox.}
  402. {}
  403.         IPMSingleFilter = record
  404.                 priority: IPMPriority;
  405.                 padByte: SInt8;
  406.                 family: OSType;                                    { family this msg belongs (e.g. mail), '??^ for all }
  407.                 script: ScriptCode;                                { Language Identifier }
  408.                 hint: IPMProcHint;
  409.                 filler2: SInt8;
  410.                 msgType: IPMMsgType;
  411.             end;
  412.  
  413.         IPMFilter = record
  414.                 count: INTEGER;
  415.                 sFilters: array[0..0] of IPMSingleFilter;
  416.             end;
  417.  
  418. {************************************************************************}
  419. {Following structures define the “start” of a recipient report block and the}
  420. {elements of the array respectively.}
  421. {}
  422.         IPMReportBlockHeader = record
  423.                 msgID: IPMMsgID;                                { message id of the original }
  424.                 creationTime: UTCTime;                                { creation time of the report }
  425.             end;
  426.  
  427.         OCERecipientReport = record
  428.                 rcptIndex: INTEGER;                                { index of recipient in original message }
  429.                 result: OSErr;                                    { result of sending letter to this recipient}
  430.             end;
  431.  
  432. {***********************************************************************}
  433.         IPMParamBlockPtr = ^IPMParamBlock;
  434.  
  435.         IPMIOCompletionProcPtr = ProcPtr;  { PROCEDURE IPMIOCompletion(paramBlock: IPMParamBlockPtr); }
  436.         IPMIOCompletionUPP = UniversalProcPtr;
  437.  
  438.         IPMOpenContextPB = record
  439.                 qLink: Ptr;
  440.                 reservedH1: LONGINT;
  441.                 reservedH2: LONGINT;
  442.                 ioCompletion: IPMIOCompletionUPP;
  443.                 ioResult: OSErr;
  444.                 saveA5: LONGINT;
  445.                 reqCode: INTEGER;
  446.                 contextRef: IPMContextRef;                            { <--  Context reference to be used in further calls}
  447.             end;
  448.  
  449.         IPMCloseContextPB = IPMOpenContextPB;
  450.  
  451.         IPMCreateQueuePB = record
  452.                 qLink: Ptr;
  453.                 reservedH1: LONGINT;
  454.                 reservedH2: LONGINT;
  455.                 ioCompletion: IPMIOCompletionUPP;
  456.                 ioResult: OSErr;
  457.                 saveA5: LONGINT;
  458.                 reqCode: INTEGER;
  459.                 filler1: LONGINT;
  460.                 queue: ^OCERecipient;
  461.                 identity: AuthIdentity;                            { used only if queue is remote }
  462.                 owner: ^PackedRecordID;                        { used only if queue is remote }
  463.             end;
  464.  
  465. { For createqueue and deletequeue only queue and identity are used }
  466.         IPMDeleteQueuePB = IPMCreateQueuePB;
  467.  
  468.         IPMOpenQueuePB = record
  469.                 qLink: Ptr;
  470.                 reservedH1: LONGINT;
  471.                 reservedH2: LONGINT;
  472.                 ioCompletion: IPMIOCompletionUPP;
  473.                 ioResult: OSErr;
  474.                 saveA5: LONGINT;
  475.                 reqCode: INTEGER;
  476.                 contextRef: IPMContextRef;
  477.                 queue: ^OCERecipient;
  478.                 identity: AuthIdentity;
  479.                 filter: ^IPMFilter;
  480.                 newQueueRef: IPMQueueRef;
  481.                 notificationProc: IPMNoteUPP;
  482.                 userData: LONGINT;
  483.                 noteType: IPMNotificationType;
  484.                 padByte: SInt8; { Byte }
  485.                 reserved: LONGINT;
  486.                 reserved2: LONGINT;
  487.             end;
  488.  
  489.         IPMCloseQueuePB = record
  490.                 qLink: Ptr;
  491.                 reservedH1: LONGINT;
  492.                 reservedH2: LONGINT;
  493.                 ioCompletion: IPMIOCompletionUPP;
  494.                 ioResult: OSErr;
  495.                 saveA5: LONGINT;
  496.                 reqCode: INTEGER;
  497.                 queueRef: IPMQueueRef;
  498.             end;
  499.  
  500.         IPMEnumerateQueuePB = record
  501.                 qLink: Ptr;
  502.                 reservedH1: LONGINT;
  503.                 reservedH2: LONGINT;
  504.                 ioCompletion: IPMIOCompletionUPP;
  505.                 ioResult: OSErr;
  506.                 saveA5: LONGINT;
  507.                 reqCode: INTEGER;
  508.                 queueRef: IPMQueueRef;
  509.                 startSeqNum: IPMSeqNum;
  510.                 getProcHint: BOOLEAN;
  511.                 getMsgType: BOOLEAN;
  512.                 filler: INTEGER;
  513.                 filter: ^IPMFilter;
  514.                 numToGet: INTEGER;
  515.                 numGotten: INTEGER;
  516.                 enumCount: LONGINT;
  517.                 enumBuffer: Ptr;                                    { will be packed array of IPMMsgInfo }
  518.                 actEnumCount: LONGINT;
  519.             end;
  520.  
  521.         IPMChangeQueueFilterPB = IPMEnumerateQueuePB;
  522.  
  523.         IPMDeleteMsgRangePB = record
  524.                 qLink: Ptr;
  525.                 reservedH1: LONGINT;
  526.                 reservedH2: LONGINT;
  527.                 ioCompletion: IPMIOCompletionUPP;
  528.                 ioResult: OSErr;
  529.                 saveA5: LONGINT;
  530.                 reqCode: INTEGER;
  531.                 queueRef: IPMQueueRef;
  532.                 startSeqNum: IPMSeqNum;
  533.                 endSeqNum: IPMSeqNum;
  534.                 lastSeqNum: IPMSeqNum;
  535.             end;
  536.  
  537.         IPMOpenMsgPB = record
  538.                 qLink: Ptr;
  539.                 reservedH1: LONGINT;
  540.                 reservedH2: LONGINT;
  541.                 ioCompletion: IPMIOCompletionUPP;
  542.                 ioResult: OSErr;
  543.                 saveA5: LONGINT;
  544.                 reqCode: INTEGER;
  545.                 queueRef: IPMQueueRef;
  546.                 sequenceNum: IPMSeqNum;
  547.                 newMsgRef: IPMMsgRef;
  548.                 actualSeqNum: IPMSeqNum;
  549.                 exactMatch: BOOLEAN;
  550.                 padByte: SInt8; { Byte }
  551.                 reserved: LONGINT;
  552.             end;
  553.  
  554.         IPMOpenHFSMsgPB = record
  555.                 qLink: Ptr;
  556.                 reservedH1: LONGINT;
  557.                 reservedH2: LONGINT;
  558.                 ioCompletion: IPMIOCompletionUPP;
  559.                 ioResult: OSErr;
  560.                 saveA5: LONGINT;
  561.                 reqCode: INTEGER;
  562.                 hfsPath: ^FSSpec;
  563.                 filler: LONGINT;
  564.                 newMsgRef: IPMMsgRef;
  565.                 filler2: LONGINT;
  566.                 filler3: SInt8; { Byte }
  567.                 filler4: BOOLEAN;
  568.                 reserved: LONGINT;
  569.             end;
  570.  
  571.         IPMOpenBlockAsMsgPB = record
  572.                 qLink: Ptr;
  573.                 reservedH1: LONGINT;
  574.                 reservedH2: LONGINT;
  575.                 ioCompletion: IPMIOCompletionUPP;
  576.                 ioResult: OSErr;
  577.                 saveA5: LONGINT;
  578.                 reqCode: INTEGER;
  579.                 msgRef: IPMMsgRef;
  580.                 filler: LONGINT;
  581.                 newMsgRef: IPMMsgRef;
  582.                 filler2: array[0..6] of INTEGER;
  583.                 blockIndex: INTEGER;
  584.             end;
  585.  
  586.         IPMCloseMsgPB = record
  587.                 qLink: Ptr;
  588.                 reservedH1: LONGINT;
  589.                 reservedH2: LONGINT;
  590.                 ioCompletion: IPMIOCompletionUPP;
  591.                 ioResult: OSErr;
  592.                 saveA5: LONGINT;
  593.                 reqCode: INTEGER;
  594.                 msgRef: IPMMsgRef;
  595.                 deleteMsg: BOOLEAN;
  596.                 filler1: BOOLEAN;
  597.             end;
  598.  
  599.         IPMGetMsgInfoPB = record
  600.                 qLink: Ptr;
  601.                 reservedH1: LONGINT;
  602.                 reservedH2: LONGINT;
  603.                 ioCompletion: IPMIOCompletionUPP;
  604.                 ioResult: OSErr;
  605.                 saveA5: LONGINT;
  606.                 reqCode: INTEGER;
  607.                 msgRef: IPMMsgRef;
  608.                 info: ^IPMMsgInfo;
  609.             end;
  610.  
  611.         IPMReadHeaderPB = record
  612.                 qLink: Ptr;
  613.                 reservedH1: LONGINT;
  614.                 reservedH2: LONGINT;
  615.                 ioCompletion: IPMIOCompletionUPP;
  616.                 ioResult: OSErr;
  617.                 saveA5: LONGINT;
  618.                 reqCode: INTEGER;
  619.                 msgRef: IPMMsgRef;
  620.                 fieldSelector: INTEGER;
  621.                 offset: LONGINT;
  622.                 count: LONGINT;
  623.                 buffer: Ptr;
  624.                 actualCount: LONGINT;
  625.                 filler: INTEGER;
  626.                 remaining: LONGINT;
  627.             end;
  628.  
  629.         IPMReadRecipientPB = record
  630.                 qLink: Ptr;
  631.                 reservedH1: LONGINT;
  632.                 reservedH2: LONGINT;
  633.                 ioCompletion: IPMIOCompletionUPP;
  634.                 ioResult: OSErr;
  635.                 saveA5: LONGINT;
  636.                 reqCode: INTEGER;
  637.                 msgRef: IPMMsgRef;
  638.                 rcptIndex: INTEGER;
  639.                 offset: LONGINT;
  640.                 count: LONGINT;
  641.                 buffer: Ptr;
  642.                 actualCount: LONGINT;
  643.                 reserved: INTEGER;                                { must be zero }
  644.                 remaining: LONGINT;
  645.                 originalIndex: INTEGER;
  646.                 recipientOffsetFlags: OCERecipientOffsetFlags;
  647.                 filler1: BOOLEAN;
  648.             end;
  649.  
  650. {}
  651. {replyQueue works like recipient. [can no longer read it via ReadHeader]}
  652. {OriginalIndex is meaningless, rcptFlags are used seperately and there are}
  653. {currently none defined.}
  654. {}
  655.         IPMReadReplyQueuePB = IPMReadRecipientPB;
  656.  
  657.         IPMGetBlkIndexPB = record
  658.                 qLink: Ptr;
  659.                 reservedH1: LONGINT;
  660.                 reservedH2: LONGINT;
  661.                 ioCompletion: IPMIOCompletionUPP;
  662.                 ioResult: OSErr;
  663.                 saveA5: LONGINT;
  664.                 reqCode: INTEGER;
  665.                 msgRef: IPMMsgRef;
  666.                 blockType: IPMBlockType;
  667.                 index: INTEGER;
  668.                 startingFrom: INTEGER;
  669.                 actualBlockType: IPMBlockType;
  670.                 actualBlockIndex: INTEGER;
  671.             end;
  672.  
  673.         IPMReadMsgPB = record
  674.                 qLink: Ptr;
  675.                 reservedH1: LONGINT;
  676.                 reservedH2: LONGINT;
  677.                 ioCompletion: IPMIOCompletionUPP;
  678.                 ioResult: OSErr;
  679.                 saveA5: LONGINT;
  680.                 reqCode: INTEGER;
  681.                 msgRef: IPMMsgRef;
  682.                 mode: IPMAccessMode;
  683.                 offset: LONGINT;
  684.                 count: LONGINT;
  685.                 buffer: Ptr;
  686.                 actualCount: LONGINT;
  687.                 blockIndex: INTEGER;
  688.                 remaining: LONGINT;
  689.             end;
  690.  
  691.         IPMVerifySignaturePB = record
  692.                 qLink: Ptr;
  693.                 reservedH1: LONGINT;
  694.                 reservedH2: LONGINT;
  695.                 ioCompletion: IPMIOCompletionUPP;
  696.                 ioResult: OSErr;
  697.                 saveA5: LONGINT;
  698.                 reqCode: INTEGER;
  699.                 msgRef: IPMMsgRef;
  700.                 signatureContext: SIGContextPtr;
  701.             end;
  702.  
  703.         IPMNewMsgPB = record
  704.                 qLink: Ptr;
  705.                 reservedH1: LONGINT;
  706.                 reservedH2: LONGINT;
  707.                 ioCompletion: IPMIOCompletionUPP;
  708.                 ioResult: OSErr;
  709.                 saveA5: LONGINT;
  710.                 reqCode: INTEGER;
  711.                 filler: LONGINT;
  712.                 recipient: ^OCERecipient;
  713.                 replyQueue: ^OCERecipient;
  714.                 procHint: StringPtr;
  715.                 filler2: INTEGER;
  716.                 msgType: ^IPMMsgType;
  717.                 refCon: LONGINT;
  718.                 newMsgRef: IPMMsgRef;
  719.                 filler3: INTEGER;
  720.                 filler4: LONGINT;
  721.                 identity: AuthIdentity;
  722.                 sender: ^IPMSender;
  723.                 internalUse: LONGINT;
  724.                 internalUse2: LONGINT;
  725.             end;
  726.  
  727.         IPMNewHFSMsgPB = record
  728.                 qLink: Ptr;
  729.                 reservedH1: LONGINT;
  730.                 reservedH2: LONGINT;
  731.                 ioCompletion: IPMIOCompletionUPP;
  732.                 ioResult: OSErr;
  733.                 saveA5: LONGINT;
  734.                 reqCode: INTEGER;
  735.                 hfsPath: ^FSSpec;
  736.                 recipient: ^OCERecipient;
  737.                 replyQueue: ^OCERecipient;
  738.                 procHint: StringPtr;
  739.                 filler2: INTEGER;
  740.                 msgType: ^IPMMsgType;
  741.                 refCon: LONGINT;
  742.                 newMsgRef: IPMMsgRef;
  743.                 filler3: INTEGER;
  744.                 filler4: LONGINT;
  745.                 identity: AuthIdentity;
  746.                 sender: ^IPMSender;
  747.                 internalUse: LONGINT;
  748.                 internalUse2: LONGINT;
  749.             end;
  750.  
  751.         IPMNestMsgPB = record
  752.                 qLink: Ptr;
  753.                 reservedH1: LONGINT;
  754.                 reservedH2: LONGINT;
  755.                 ioCompletion: IPMIOCompletionUPP;
  756.                 ioResult: OSErr;
  757.                 saveA5: LONGINT;
  758.                 reqCode: INTEGER;
  759.                 msgRef: IPMMsgRef;
  760.                 filler: array[0..8] of INTEGER;
  761.                 refCon: LONGINT;
  762.                 msgToNest: IPMMsgRef;
  763.                 filler2: INTEGER;
  764.                 startingOffset: LONGINT;
  765.             end;
  766.  
  767.         IPMNewNestedMsgBlockPB = record
  768.                 qLink: Ptr;
  769.                 reservedH1: LONGINT;
  770.                 reservedH2: LONGINT;
  771.                 ioCompletion: IPMIOCompletionUPP;
  772.                 ioResult: OSErr;
  773.                 saveA5: LONGINT;
  774.                 reqCode: INTEGER;
  775.                 msgRef: IPMMsgRef;
  776.                 recipient: ^OCERecipient;
  777.                 replyQueue: ^OCERecipient;
  778.                 procHint: StringPtr;
  779.                 filler1: INTEGER;
  780.                 msgType: ^IPMMsgType;
  781.                 refCon: LONGINT;
  782.                 newMsgRef: IPMMsgRef;
  783.                 filler2: INTEGER;
  784.                 startingOffset: LONGINT;
  785.                 identity: AuthIdentity;
  786.                 sender: ^IPMSender;
  787.                 internalUse: LONGINT;
  788.                 internalUse2: LONGINT;
  789.             end;
  790.  
  791.         IPMEndMsgPB = record
  792.                 qLink: Ptr;
  793.                 reservedH1: LONGINT;
  794.                 reservedH2: LONGINT;
  795.                 ioCompletion: IPMIOCompletionUPP;
  796.                 ioResult: OSErr;
  797.                 saveA5: LONGINT;
  798.                 reqCode: INTEGER;
  799.                 msgRef: IPMMsgRef;
  800.                 msgID: IPMMsgID;
  801.                 msgTitle: ^RString;
  802.                 deliveryNotification: IPMNotificationType;
  803.                 priority: IPMPriority;
  804.                 cancel: BOOLEAN;
  805.                 padByte: SInt8; { Byte }
  806.                 reserved: LONGINT;
  807.                 signature: SIGSignaturePtr;
  808.                 signatureSize: Size;
  809.                 signatureContext: SIGContextPtr;
  810.         { family this msg belongs (e.g. mail) use kIPMFamilyUnspecified by default }
  811.                 family: OSType;
  812.             end;
  813.  
  814.         IPMAddRecipientPB = record
  815.                 qLink: Ptr;
  816.                 reservedH1: LONGINT;
  817.                 reservedH2: LONGINT;
  818.                 ioCompletion: IPMIOCompletionUPP;
  819.                 ioResult: OSErr;
  820.                 saveA5: LONGINT;
  821.                 reqCode: INTEGER;
  822.                 msgRef: IPMMsgRef;
  823.                 recipient: ^OCERecipient;
  824.                 reserved: LONGINT;
  825.             end;
  826.  
  827.         IPMAddReplyQueuePB = record
  828.                 qLink: Ptr;
  829.                 reservedH1: LONGINT;
  830.                 reservedH2: LONGINT;
  831.                 ioCompletion: IPMIOCompletionUPP;
  832.                 ioResult: OSErr;
  833.                 saveA5: LONGINT;
  834.                 reqCode: INTEGER;
  835.                 msgRef: IPMMsgRef;
  836.                 filler: LONGINT;
  837.                 replyQueue: ^OCERecipient;
  838.             end;
  839.  
  840.         IPMNewBlockPB = record
  841.                 qLink: Ptr;
  842.                 reservedH1: LONGINT;
  843.                 reservedH2: LONGINT;
  844.                 ioCompletion: IPMIOCompletionUPP;
  845.                 ioResult: OSErr;
  846.                 saveA5: LONGINT;
  847.                 reqCode: INTEGER;
  848.                 msgRef: IPMMsgRef;
  849.                 blockType: IPMBlockType;
  850.                 filler: array[0..4] of INTEGER;
  851.                 refCon: LONGINT;
  852.                 filler2: array[0..2] of INTEGER;
  853.                 startingOffset: LONGINT;
  854.             end;
  855.  
  856.         IPMWriteMsgPB = record
  857.                 qLink: Ptr;
  858.                 reservedH1: LONGINT;
  859.                 reservedH2: LONGINT;
  860.                 ioCompletion: IPMIOCompletionUPP;
  861.                 ioResult: OSErr;
  862.                 saveA5: LONGINT;
  863.                 reqCode: INTEGER;
  864.                 msgRef: IPMMsgRef;
  865.                 mode: IPMAccessMode;
  866.                 offset: LONGINT;
  867.                 count: LONGINT;
  868.                 buffer: Ptr;
  869.                 actualCount: LONGINT;
  870.                 currentBlock: BOOLEAN;
  871.                 filler1: BOOLEAN;
  872.             end;
  873.  
  874.         IPMParamBlock = record
  875.                 case INTEGER of
  876.                     0: (
  877.                             qLink: Ptr;
  878.                             reservedH1: LONGINT;
  879.                             reservedH2: LONGINT;
  880.                             ioCompletion: IPMIOCompletionUPP;
  881.                             ioResult: OSErr;
  882.                             saveA5: LONGINT;
  883.                             reqCode: INTEGER;
  884.                     );
  885.                     1: (
  886.                             openContextPB: IPMOpenContextPB;
  887.                     );
  888.                     2: (
  889.                             closeContextPB: IPMCloseContextPB;
  890.                     );
  891.                     3: (
  892.                             createQueuePB: IPMCreateQueuePB;
  893.                     );
  894.                     4: (
  895.                             deleteQueuePB: IPMDeleteQueuePB;
  896.                     );
  897.                     5: (
  898.                             openQueuePB: IPMOpenQueuePB;
  899.                     );
  900.                     6: (
  901.                             closeQueuePB: IPMCloseQueuePB;
  902.                     );
  903.                     7: (
  904.                             enumerateQueuePB: IPMEnumerateQueuePB;
  905.                     );
  906.                     8: (
  907.                             changeQueueFilterPB: IPMChangeQueueFilterPB;
  908.                     );
  909.                     9: (
  910.                             deleteMsgRangePB: IPMDeleteMsgRangePB;
  911.                     );
  912.                     10: (
  913.                             openMsgPB: IPMOpenMsgPB;
  914.                     );
  915.                     11: (
  916.                             openHFSMsgPB: IPMOpenHFSMsgPB;
  917.                     );
  918.                     12: (
  919.                             openBlockAsMsgPB: IPMOpenBlockAsMsgPB;
  920.                     );
  921.                     13: (
  922.                             closeMsgPB: IPMCloseMsgPB;
  923.                     );
  924.                     14: (
  925.                             getMsgInfoPB: IPMGetMsgInfoPB;
  926.                     );
  927.                     15: (
  928.                             readHeaderPB: IPMReadHeaderPB;
  929.                     );
  930.                     16: (
  931.                             readRecipientPB: IPMReadRecipientPB;
  932.                     );
  933.                     17: (
  934.                             readReplyQueuePB: IPMReadReplyQueuePB;
  935.                     );
  936.                     18: (
  937.                             getBlkIndexPB: IPMGetBlkIndexPB;
  938.                     );
  939.                     19: (
  940.                             readMsgPB: IPMReadMsgPB;
  941.                     );
  942.                     20: (
  943.                             verifySignaturePB: IPMVerifySignaturePB;
  944.                     );
  945.                     21: (
  946.                             newMsgPB: IPMNewMsgPB;
  947.                     );
  948.                     22: (
  949.                             newHFSMsgPB: IPMNewHFSMsgPB;
  950.                     );
  951.                     23: (
  952.                             nestMsgPB: IPMNestMsgPB;
  953.                     );
  954.                     24: (
  955.                             newNestedMsgBlockPB: IPMNewNestedMsgBlockPB;
  956.                     );
  957.                     25: (
  958.                             endMsgPB: IPMEndMsgPB;
  959.                     );
  960.                     26: (
  961.                             addRecipientPB: IPMAddRecipientPB;
  962.                     );
  963.                     27: (
  964.                             addReplyQueuePB: IPMAddReplyQueuePB;
  965.                     );
  966.                     28: (
  967.                             newBlockPB: IPMNewBlockPB;
  968.                     );
  969.                     29: (
  970.                             writeMsgPB: IPMWriteMsgPB;
  971.                     );
  972.             end;
  973.  
  974.     const
  975.         uppIPMIOCompletionProcInfo = $000000C0; { PROCEDURE (4 byte param); }
  976.  
  977.     procedure CallIPMIOCompletionProc (paramBlock: IPMParamBlockPtr; userRoutine: IPMIOCompletionUPP);
  978.     {$IFC NOT GENERATINGCFM}
  979.     inline
  980.         $205F, $4E90;
  981.     {$ENDC}
  982.  
  983.     function NewIPMIOCompletionProc (userRoutine: IPMIOCompletionProcPtr): IPMIOCompletionUPP;
  984.     {$IFC NOT GENERATINGCFM }
  985.     inline
  986.         $2E9F;
  987.     {$ENDC}
  988.  
  989.     function IPMOpenContext (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  990.     {$IFC NOT GENERATINGCFM}
  991.     inline
  992.         $3F3C, $400, $AA5E;
  993.     {$ENDC}
  994.     function IPMCloseContext (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  995.     {$IFC NOT GENERATINGCFM}
  996.     inline
  997.         $3F3C, $401, $AA5E;
  998.     {$ENDC}
  999.     function IPMNewMsg (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1000.     {$IFC NOT GENERATINGCFM}
  1001.     inline
  1002.         $3F3C, $402, $AA5E;
  1003.     {$ENDC}
  1004.     function IPMNewBlock (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1005.     {$IFC NOT GENERATINGCFM}
  1006.     inline
  1007.         $3F3C, $404, $AA5E;
  1008.     {$ENDC}
  1009.     function IPMNewNestedMsgBlock (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1010.     {$IFC NOT GENERATINGCFM}
  1011.     inline
  1012.         $3F3C, $405, $AA5E;
  1013.     {$ENDC}
  1014.     function IPMNestMsg (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1015.     {$IFC NOT GENERATINGCFM}
  1016.     inline
  1017.         $3F3C, $406, $AA5E;
  1018.     {$ENDC}
  1019.     function IPMWriteMsg (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1020.     {$IFC NOT GENERATINGCFM}
  1021.     inline
  1022.         $3F3C, $407, $AA5E;
  1023.     {$ENDC}
  1024.     function IPMEndMsg (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1025.     {$IFC NOT GENERATINGCFM}
  1026.     inline
  1027.         $3F3C, $408, $AA5E;
  1028.     {$ENDC}
  1029.     function IPMOpenQueue (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1030.     {$IFC NOT GENERATINGCFM}
  1031.     inline
  1032.         $3F3C, $409, $AA5E;
  1033.     {$ENDC}
  1034.     function IPMCloseQueue (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1035.     {$IFC NOT GENERATINGCFM}
  1036.     inline
  1037.         $3F3C, $40A, $AA5E;
  1038.     {$ENDC}
  1039. { Always synchronous }
  1040.     function IPMVerifySignature (paramBlock: IPMParamBlockPtr): OSErr;
  1041.     {$IFC NOT GENERATINGCFM}
  1042.     inline
  1043.         $7000, $1f00, $3F3C, $422, $AA5E;
  1044.     {$ENDC}
  1045.     function IPMOpenMsg (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1046.     {$IFC NOT GENERATINGCFM}
  1047.     inline
  1048.         $3F3C, $40B, $AA5E;
  1049.     {$ENDC}
  1050.     function IPMCloseMsg (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1051.     {$IFC NOT GENERATINGCFM}
  1052.     inline
  1053.         $3F3C, $40C, $AA5E;
  1054.     {$ENDC}
  1055.     function IPMReadMsg (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1056.     {$IFC NOT GENERATINGCFM}
  1057.     inline
  1058.         $3F3C, $40D, $AA5E;
  1059.     {$ENDC}
  1060.     function IPMReadHeader (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1061.     {$IFC NOT GENERATINGCFM}
  1062.     inline
  1063.         $3F3C, $40E, $AA5E;
  1064.     {$ENDC}
  1065.     function IPMOpenBlockAsMsg (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1066.     {$IFC NOT GENERATINGCFM}
  1067.     inline
  1068.         $3F3C, $40F, $AA5E;
  1069.     {$ENDC}
  1070.     function IPMNewHFSMsg (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1071.     {$IFC NOT GENERATINGCFM}
  1072.     inline
  1073.         $3F3C, $41E, $AA5E;
  1074.     {$ENDC}
  1075.     function IPMReadRecipient (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1076.     {$IFC NOT GENERATINGCFM}
  1077.     inline
  1078.         $3F3C, $410, $AA5E;
  1079.     {$ENDC}
  1080.     function IPMReadReplyQueue (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1081.     {$IFC NOT GENERATINGCFM}
  1082.     inline
  1083.         $3F3C, $421, $AA5E;
  1084.     {$ENDC}
  1085.     function IPMCreateQueue (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1086.     {$IFC NOT GENERATINGCFM}
  1087.     inline
  1088.         $3F3C, $411, $AA5E;
  1089.     {$ENDC}
  1090.     function IPMDeleteQueue (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1091.     {$IFC NOT GENERATINGCFM}
  1092.     inline
  1093.         $3F3C, $412, $AA5E;
  1094.     {$ENDC}
  1095.     function IPMEnumerateQueue (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1096.     {$IFC NOT GENERATINGCFM}
  1097.     inline
  1098.         $3F3C, $413, $AA5E;
  1099.     {$ENDC}
  1100.     function IPMChangeQueueFilter (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1101.     {$IFC NOT GENERATINGCFM}
  1102.     inline
  1103.         $3F3C, $414, $AA5E;
  1104.     {$ENDC}
  1105.     function IPMDeleteMsgRange (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1106.     {$IFC NOT GENERATINGCFM}
  1107.     inline
  1108.         $3F3C, $415, $AA5E;
  1109.     {$ENDC}
  1110.     function IPMAddRecipient (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1111.     {$IFC NOT GENERATINGCFM}
  1112.     inline
  1113.         $3F3C, $403, $AA5E;
  1114.     {$ENDC}
  1115.     function IPMAddReplyQueue (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1116.     {$IFC NOT GENERATINGCFM}
  1117.     inline
  1118.         $3F3C, $41D, $AA5E;
  1119.     {$ENDC}
  1120.     function IPMOpenHFSMsg (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1121.     {$IFC NOT GENERATINGCFM}
  1122.     inline
  1123.         $3F3C, $417, $AA5E;
  1124.     {$ENDC}
  1125.     function IPMGetBlkIndex (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1126.     {$IFC NOT GENERATINGCFM}
  1127.     inline
  1128.         $3F3C, $418, $AA5E;
  1129.     {$ENDC}
  1130.     function IPMGetMsgInfo (paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1131.     {$IFC NOT GENERATINGCFM}
  1132.     inline
  1133.         $3F3C, $419, $AA5E;
  1134.     {$ENDC}
  1135.  
  1136. { $ALIGN RESET}
  1137. { $POP}
  1138.  
  1139. {$ENDC}
  1140.  {__OCEMESSAGING__}
  1141.  
  1142. implementation
  1143. end.
  1144.